import http from '@/api'

// 获取智能体详情
export const queryAgentDetailApi = {
  getData(params) {
    return http.get('/call-robot-engine/callAgent/getAgentDetail', params)
  },
  handleData(data) {
    console.log('data', data)
    return {
      baseConfig: {
        avatar: Array.of({
          agentImg: data.agentImg,
          agentImgUrl: data.agentImgUrl,
        }),
        agentName: data.agentName,
        agentDes: data.agentDesc,
        businessType: data.businessType,
        businessScene: data.businessLabel,
        prompt: data.agentPrompt && {
          prompt: data.agentPrompt.agentPrompt,
          limitPrompt: data.agentPrompt.limitPrompt,
          rolePrompt: data.agentPrompt.rolePrompt,
          targetPrompt: data.agentPrompt.targetPrompt,
          variableList: data.agentPrompt.variableList,
        },
      },
    }
  },
}

// 获取纠错词列表
export const queryCorrectionErrorListApi = {
  getData(params) {
    return http.get('/call-robot-engine/robot-intention-tag-group/list', params)
  },
  handleData(data) {
    return data.map((item) => {
      return {
        label: item.groupName,
        value: item.id,
      }
    })
  },
}

// 获取业务场景列表
export const queryBusinessSceneListApi = (params) =>
  http.get('/call-rest/reported/companyLineLabel/getCompanyLabelList', params)

// 获取知识库列表
export const queryKnowledgeListApi = (params) =>
  http.get('/badu-im-kouzi/ai-kouzi-repository-classify/aiKouziRepositoryClassifyList', params)

// 获取意向标签组列表
export const queryIntentionTagListApi = (params) =>
  http.get('/call-robot-engine/robot-intention-tag-group/list', params)
